﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WisDom.SmartTMS.Entity;

namespace WisDom.SmartTMS.Validator
{
    /// <summary>
    /// 人事登记的验证器
    /// </summary>
    public class PersonnelRegisterValidator : IEntityTypeConfiguration<PersonnelRegister>
    {
        public void Configure(EntityTypeBuilder<PersonnelRegister> builder)
        {
            builder.ToTable("PersonnelRegister");
            builder.Property("RegName").HasMaxLength(50).IsRequired();
            builder.Property("RegSection").HasMaxLength(50).IsRequired();
            builder.Property("RegPhone").HasMaxLength(50).IsRequired();
            builder.Property("Academy").HasMaxLength(50).IsRequired();
            builder.Property("Specialty").HasMaxLength(50).IsRequired();
            builder.Property("RegHome").HasMaxLength(50).IsRequired();
            builder.Property("Sort").HasMaxLength(50).IsRequired();
            builder.Property("State").HasMaxLength(50).IsRequired();
            builder.Property("Education").HasMaxLength(50).IsRequired();
            builder.Property("PoliticsStatus").HasMaxLength(50).IsRequired();
            builder.Property("Family").HasMaxLength(50).IsRequired();
            builder.Property("NativePlace").HasMaxLength(50).IsRequired();
            builder.Property("MaritalStatus").HasMaxLength(50).IsRequired();
            builder.Property("PostBox").HasMaxLength(50).IsRequired();
            builder.Property("IDNumber").HasMaxLength(50).IsRequired();
            builder.Property("DateofBirth").HasColumnType("date").IsRequired();
            builder.Property("CreateTimes").HasColumnType("date").IsRequired();
            builder.Property<int>("RegSex").HasColumnType("int").IsRequired();
            builder.Property<int>("Seniority").HasColumnType("int").IsRequired();
        }
    }
}
